package com.ruoyi.web.controller.report.admin;


import com.ruoyi.common.constant.ReportConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.finereport.domain.vo.InfoVo;
import com.ruoyi.system.service.ISysConfigService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/finereport")
public class FineReportController extends BaseController {


    @Resource
    private ISysConfigService sysConfigService;


    @GetMapping("/info")
    public AjaxResult selectInfo() {
        InfoVo vo = new InfoVo();
        String reportBaseUrl = sysConfigService.selectConfigByKey(ReportConstants.REPORT_BASE_URL);
        vo.setReportBaseUrl(reportBaseUrl);
        String dailyEmploymentStatisticsReport = sysConfigService.selectConfigByKey(ReportConstants.DAILY_EMPLOYMENT_STATISTICS_REPORT);
        vo.setDailyEmploymentStatisticsReport(dailyEmploymentStatisticsReport);
        String dailyDepartmentEmploymentStatisticsReport = sysConfigService.selectConfigByKey(ReportConstants.DAILY_DEPARTMENT_EMPLOYMENT_STATISTICS_REPORT);
        vo.setDailyDepartmentEmploymentStatisticsReport(dailyDepartmentEmploymentStatisticsReport);
        String dailyMajorEmploymentStatisticsReport = sysConfigService.selectConfigByKey(ReportConstants.DAILY_MAJOR_EMPLOYMENT_STATISTICS_REPORT);
        vo.setDailyMajorEmploymentStatisticsReport(dailyMajorEmploymentStatisticsReport);
        String dailyGroupEmploymentStatisticsReport = sysConfigService.selectConfigByKey(ReportConstants.DAILY_GROUP_EMPLOYMENT_STATISTICS_REPORT);
        vo.setDailyGroupEmploymentStatisticsReport(dailyGroupEmploymentStatisticsReport);
        String dailyCounsellorEmploymentStatisticsReport = sysConfigService.selectConfigByKey(ReportConstants.DAILY_COUNSELLOR_EMPLOYMENT_STATISTICS_REPORT);
        vo.setDailyCounsellorEmploymentStatisticsReport(dailyCounsellorEmploymentStatisticsReport);
        String reportUrlParameters = sysConfigService.selectConfigByKey(ReportConstants.REPORT_URL_PARAMETERS);
        vo.setReportUrlParameters(reportUrlParameters);
        String reportNoPage = sysConfigService.selectConfigByKey(ReportConstants.REPORT_NO_PAGE);
        vo.setReportNoPage(reportNoPage);
        return success(vo);
    }
}
